#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <stdlib.h>
struct student
{
    int num;
    char name[20];
    float score;
};

int cmp(const void* e1, const void* e2)
{
    float a = ((struct student*)e1)->score;
    float b = ((struct student*)e2)->score;
    return (int)(b - a);
}

void sort(struct student stu[]) {
    /********begin********/
    qsort(stu, 5, sizeof(struct student), cmp);

    /******** End ********/
}

int main() {
    struct student stu[5];
    const int n = 5;
    int i;
    for (i = 0; i < 5; i++) scanf("%d%s%f", &stu[i].num, stu[i].name, &stu[i].score);
    /********begin********/
    sort(stu);



    /******** End ********/
    for (i = 0; i < n; i++)
        printf("%d %s %.2f\n", stu[i].num, stu[i].name, stu[i].score);
    return 0;
}